<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml"
      layout:decorate="~{front/common/framework}" xmlns:layout="http://www.w3.org/1999/xhtml">
<head>
  <title>DNA认证详情</title>
  <link rel="stylesheet" href="/static/front/css/auth-detail.css">
</head>

<body>
<div layout:fragment="content">
  <div class="container5 wrapper">
    <div class="head">
      <h2>DNA认证详情</h2>
    </div>

  </div>
</div>

<th:block layout:fragment="script">

  <script type="text/javascript">
    layui.use('laytpl',function () {
      var laytpl = layui.laytpl,
          dna = Util.getQueryString('dna');

      var height = $(document).height()-334;
      $('.container5').css('min-height',height);

      $.getJSON('/copyright/getDnaDetail',{dna:dna},function (result) {
        if(result.code=='ok'){
          var getTpl = $('#tpl').html(),
              tbody = $(".container5");
          laytpl(getTpl).render(result, function (html) {
            tbody.append(html);
          });
        }else{
          $(".container5").append("<div style='text-align: center;font-size: 16px;margin-top: 40px;'>区块链DNA信息正在上传中，请稍后查看！</div>")
        }

      })
    })
  </script>

  <script type="text/html" id="tpl">
    <div class="dna-auth">
      <div class="hint-info">
        <ul>
          <li><label>标题：</label>{{ d.data.title}}</li>
          <li><label>作者：</label> {{ d.data.extra.author}} </li>
          <li><label>发布时间：</label>{{ d.tx.time}}</li>
          <li><label>图片分辨率：</label>{{d.data.data.width}} x {{d.data.data.height}}</li>
          <li><label>文件大小：</label>{{d.data.data.size/1024/1024}}</li>
          <li><label>原本DNA：</label>{{d.data.dna.substring(0,6)}}</li>
          </li>
        </ul>
      </div>
      <div class="detail-info">
        <ul>
          <li>
            <h4>完整原本DNA</h4>
            <div class="txt">
              <p>{{d.data.dna}}</p>
            </div>
          </li>
          <li>
            <h4>图片内容Hash</h4>
            <div class="txt">
              <p> {{d.data.contentHash}} </p>
            </div>
          </li>
          <li>
            <h4>图片区块链Hash</h4>
            <div class="txt">
              <p> {{d.data.blockHash}}</p>
            </div>
          </li>
          <li>
            <h4>签名字符串</h4>
            <div class="txt">
              <p>
                【作者：{{ d.data.extra.author}}，发布时间戳：{{d.data.created}}】【图像分辨率：{{d.data.data.width}} x
                {{d.data.data.height}}，文件大小：{{d.data.data.size}}，片SHA1：{{d.data.contentHash}}】【协议：{”type”:”{{d.data.license.type}}”,”content”;{”outdoors”:”{{d.data.license.parameters.outdoors}}”}}】</p>
            </div>
          </li>
          <li>
            <h4>数字签名</h4>
            <div class="txt">
              <p> {{d.data.signature}}</p>
            </div>
          </li>
          <li>
            <h4>签名公钥</h4>
            <div class="txt">
              <p>---------BEGIN PUBLIC KEY---------<br>
                {{ d.data.pubKey}}
              </p>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </script>

</th:block>
</body>
</html>

